<?php

/**
 * login actions.
 *
 * @package    Redsea20
 * @subpackage login
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class loginActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    //$this->forward('default', 'module');
      $sysDate = getdate();
      $this->hour = sfConfig::get('sf_upload_dir');
      //$this->getUser()->setFlash('message','SUCCESSFUL');
  }

  public function  executeLogin()
  {
    sView::SUCCESS;
  }

  public function executePrepareLogin()
  {
    if($this->getRequest()->getMethid() != sfRequest::POST)
    {
        sView::SUCCESS;
    }
    else
    {
        $usr = $this->getRequestParameter('username');
        $pwd  =  $this->getRequestParameter('password');

        //$pwd = md5($pwd);

        if($usr == "test" && $pwd == "test")
        {
            echo 'LOGIN SUCCESS';
        }
        else
        {

            echo 'LOGIN FAIL';
        }
    }
  }  
}
